package com.dm.shop.controller;

import com.dm.shop.service.QnUploadSerive;
import com.dm.shop.utils.ResultUtil;
import com.dm.shop.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @version 1.0
 * @author: Saiya Wang
 * @desc:
 * @date: 2021/7/24 11:20
 */
@CrossOrigin
@RestController
@RequestMapping("/qiniu")
public class QnController {
    @Autowired
    QnUploadSerive qnUploadSerive;

    @GetMapping("/token")
    public Result getToken()
    {
        HashMap hashMap = new HashMap();
        hashMap.put("token",qnUploadSerive.getUploadToken());
        return ResultUtil.success(hashMap);
    }
}
